#include "opensplice_dds_broker/GSDFPacketSplDcps.h"
#include "opensplice_dds_broker/ccpp_GSDFPacket.h"
#include "dds_type_aliases.h"

const char *
__opensplice_dds_broker_GSDFPacket__name(void)
{
    return (const char*)"opensplice_dds_broker::GSDFPacket";
}

const char *
__opensplice_dds_broker_GSDFPacket__keys(void)
{
    return (const char*)"";
}

#include <v_kernel.h>
#include <v_topic.h>
#include <os_stdlib.h>
#include <string.h>
#include <os_report.h>

c_bool
__opensplice_dds_broker_CharSeq__copyIn(
    c_base base,
    ::opensplice_dds_broker::CharSeq *from,
    _opensplice_dds_broker_CharSeq *to)
{
    c_bool result = OS_C_TRUE;
    (void) base;

/* Code generated by /home/dds/OvernightTests/tmp.Zi75hUiMaK/build/src/tools/idlpp/code/idl_genCorbaCxxCopyin.c at line 2411 */

    static c_type type0 = NULL;
    c_type subtype0 = NULL;
    c_long length0;
    c_char *dest0;

    if (type0 == NULL) {
        subtype0 = c_type(c_metaResolve (c_metaObject(base), "c_char"));
        type0 = c_metaSequenceTypeNew(c_metaObject(base),"C_SEQUENCE<c_char>",subtype0,0);
        c_free(subtype0);
    }
    length0 = (c_long)(*from).length();
#ifdef OSPL_BOUNDS_CHECK
    dest0 = (c_char *)c_newSequence(c_collectionType(type0), length0);
    {
    /* Code generated by /home/dds/OvernightTests/tmp.Zi75hUiMaK/build/src/tools/idlpp/code/idl_genCorbaCxxCopyin.c at line 1873 */
            c_char *buf0;
        buf0 = (c_char *)(*from).get_buffer();
        memcpy (dest0,buf0,length0* sizeof(*dest0));
    }
    *to = (_opensplice_dds_broker_CharSeq)dest0;
#else
    dest0 = (c_char *)c_newSequence(c_collectionType(type0), length0);
    {
    /* Code generated by /home/dds/OvernightTests/tmp.Zi75hUiMaK/build/src/tools/idlpp/code/idl_genCorbaCxxCopyin.c at line 1873 */
            c_char *buf0;
        buf0 = (c_char *)(*from).get_buffer();
        memcpy (dest0,buf0,length0* sizeof(*dest0));
    }
    *to = (_opensplice_dds_broker_CharSeq)dest0;
#endif
    return result;
}

c_bool
__opensplice_dds_broker_GSDFPacket__copyIn(
    c_base base,
    struct ::opensplice_dds_broker::GSDFPacket *from,
    struct _opensplice_dds_broker_GSDFPacket *to)
{
    c_bool result = OS_C_TRUE;
    (void) base;

    if(result){
        extern c_bool __opensplice_dds_broker_CharSeq__copyIn(c_base, ::opensplice_dds_broker::CharSeq *, _opensplice_dds_broker_CharSeq *);
        result = __opensplice_dds_broker_CharSeq__copyIn(base, &from->data, &to->data);
    }
    return result;
}

void
__opensplice_dds_broker_CharSeq__copyOut(
    void *_from,
    void *_to)
{
    _opensplice_dds_broker_CharSeq *from = (_opensplice_dds_broker_CharSeq *)_from;
    ::opensplice_dds_broker::CharSeq *to = (::opensplice_dds_broker::CharSeq *)_to;
    long size0;
    c_char *src0 = (c_char *)(*from);

    size0 = c_arraySize(c_sequence(src0));
    (*to).length(size0);
    {
        c_char *buf0;
        buf0 = (c_char *)(*to).get_buffer();
        memcpy (buf0,src0,size0* sizeof(*buf0));
    }
}

void
__opensplice_dds_broker_GSDFPacket__copyOut(
    void *_from,
    void *_to)
{
    struct _opensplice_dds_broker_GSDFPacket *from = (struct _opensplice_dds_broker_GSDFPacket *)_from;
    struct ::opensplice_dds_broker::GSDFPacket *to = (struct ::opensplice_dds_broker::GSDFPacket *)_to;
    {
        extern void __opensplice_dds_broker_CharSeq__copyOut(void *, void *);
        __opensplice_dds_broker_CharSeq__copyOut((void *)&from->data, (void *)&to->data);
    }
}

